package lee.base.xmlformat;

import lee.base.constant.XmlAttribute;
import lee.base.structure.MyHashTree;
import lee.base.structure.MyNode;
import lee.base.structure.Position;
import lee.base.structure.Size;

public class FrameFormat {
	
	public static AttrValImageItem getImageItem(MyHashTree tree, MyNode nodeHead, boolean screenType) {
		String splitPoint = XmlAttribute.VARIABLE_POINT + "";
		String rootDir = tree.ACT002_getSpecificValue("$ref1" + splitPoint + "root_dir", null);
		String headAttr = nodeHead.GET003_attribute() + splitPoint;
		String getFileNameImage = tree.ACT002_getSpecificValue(headAttr + "image", nodeHead);
		Size getSize = BaseFormat.getSize(tree, nodeHead);
		Position pos = BaseFormat.getPosition(tree, nodeHead, screenType);
		return new AttrValImageItem(rootDir + "/" + getFileNameImage, getSize, pos);
	}
}
